<?php

class Controller_Admin_Setting_General  extends Controller_Admin_Abstract
{
	function execute($request)
	{
		$form = new Form_Admin_Setting_General;

		$name = 'general';

		if ($request -> isGet())
		{
			$values = (array)Agilet::getSetting($name);
			$form -> setValues($values);
		}

		if ($request -> isPost() && $form -> isValid($_POST))
		{
			$value = $form -> getValues();
			unset($value['buttons']);
			Agilet::setSetting($name, $value);
		}
		$request -> response = View::render($data = array('form' => $form), 'controller/admin/edit.tpl');
	}

}
